<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			var rightuser="张智";
			var rightpassword="233500";
			var rightcold=Math.floor(Math.random()*9000+1000);
			
			var inputuser=prompt("请输入用户名");
			
			if(rightuser==inputuser){
				var inputpassword=prompt("请输入密码");
				if (inputpassword==rightpassword) {
					var inputcold=prompt("请输入验证码"+rightcold);
					if(inputcold==rightcold){
						alert("登录成功");
					}else{
						alert("验证码错误，登录失败");
					}
				}else{
					alert("密码错误");
				}
			}else{
				alert("用户名错误");
			}
		</script>
	</head>
	<body>
	</body>
</html>
